Customize UI By Connecting To COM Events

SoftwareShield System Feature Guide > User Interface Customization > Customize UI by Connecting to COM Events

## Customize UI by Connecting to COM Events

The ClientProtector component, which is the COM server that enforces the logic of your license, on occasion will need feedback from your user (or at the very least from your program) in the middle of a function call. However, you must be able to completely control the user interface of all aspect of your program to suit your audience and their needs as well as presenting a consistent look and feel. You may also have specific localization or language needs. The ClientProtector facilitates these needs by firing COM events to your software when it needs feedback in the middle of a call - delegating necessary user interaction to your software so you can completely control the UI.

Your application can easily define an event handler (sometimes called a call-back function although technically they are different) that the ClientProtector might call while it is processing. Your application does not need to define these event handlers if you do not require them. In the event that they are fired with no handlers connected to them, a default behaviour is invoked. Each event handler section noted below notes the default behaviour.

There are seven event handlers which you might need to connect to:

1. OnMissingLicenseFile. Fired during the context of the StartUp function call if the Main License File is not in the location indicated. This gives you the opportunity to warn the user, ask them to browse for the Main License File and give them an "Open Dialog" in order to identify its location.

2. OnAttemptReleaseCP. Fired only if you have enabled Copy Protection in your license and within the context of the StartUp function. Gives your application an opportunity to allow the user to obtain an Authorization Request Code to release Copy Protection and also to release it by entering an Activation Code.

3. OnAttemptRecover. Fired only if you have enabled Prompt to Recover in your license and within the context of the StartUp function call. In the event of a license problem which can only be corrected by a "recovery", gives your application the opportunity to allow the user to obtain an Authorization Request Code to recover the license and also to actually recover it by entering an Activation Code.

4. OnAttemptDeactivate. Fired only if you have defined a Deactivate License Authorization Definition in your license and within the context of the RequestDeactivation function call.

5. OnAttemptCheckInCopyProtection. Fired if you are attempting to Check-In a Serial Number which was used to Release Copy-Protection.

6. OnAutoActivateResult. Fired when processing returns from a call to the CheckPoint License Server from within the scope of the StartUp call. This is only ever fired when Copy-Protection is enabled.

7. OnPrepareAutoActivate. Fired in the scope of the StartUp call to give the user the chance to decide if they want to perform an Automated Activation with the CheckPoint License Server or not. Also allows you to determine if the CheckPoint License Server can be contacted from the users machine and perform connectivity tests if necessary.

Each of these event handlers have a different set of specific value and reference parameters which will both provide necessary information to your application and allow you to feed-back information to the ClientProtector from either the user, or directly from your application.

#### More Information

To fully understand the logic that is taking place inside the ClientProtector and when these events will be fired, please refer to the SoftwareShield ClientProtector Control Flow-Charts.

For help on actually connecting to the ClientProtector events, see Creating a ClientProtector COM Event Sink in the SoftwareShield ClientProtector Reference.